/*
 * Copyright (c) 2024 iSOFT INFRASTRUCTURE SOFTWARE CO., LTD.
 * easyAda is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */

#ifndef __UAPI_ERRORS_H__
#define __UAPI_ERRORS_H__

enum err_errors {
    ESUCCESS = 0,
    ECANCELED,
    EINVALID,
    ENOCAP,
    EOVERLAP,
    ENOSYS,
    EPERMIT,
    EGENERAL,
    ENOMEM,
    EAGAIN,

    ENOL1PT,
    ENOL2PT,
    ENOL3PT,
    ENOL4PT,

    /* for armv8-a  pagetable */
    ENOMAPPING,
};
enum err_errors2 {
    /* for fatfs */
    EIO        = 5,
    ECOMM      = 70,
    ETIMEDOUT  = 110,
    EOPNOTSUPP = 95,
    EBADMSG    = 74,
    ENOMEDIUM  = 123,
    EINVAL     = 22,
    EBUSY      = 16,
    ENOENT     = 2,
    ENOSPC     = 28,
    /* for vfs */
    EEXIST       = 40,
    EROFS        = 30,
    EISDIR       = 21,
    EBADF        = 9,
    ENOTDIR      = 20,
    EMUTEXLOCKED = 2010,
    EOCCUPIED,
};

#define ERR_TO_RETCODE(err) (uint64_t)(err)
#endif
